home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / dev / www-talk.9301-9306.Z / www-talk.9301-9306 / text0670.txt < prev    next >
Encoding:
Text File  |  1995-04-24  |  3.3 KB  |  102 lines

  1.  
  2.  
  3. I am testing out the new library (2.alpha?) which has a lot of
  4. new features largely as a result comment on this list (many from
  5. Dan Connoly, but also others). So I thought I'd bounce the end result  
  6. off you all as to check it for stupidities.
  7.  
  8. The driving forces are putting in MIME, and allowing the library
  9. to be used by disparate browsers and editors and servers without
  10. modification.
  11.  
  12. The thing is still all portable C but even more OO in style. Two new  
  13. objects are HTStream which is something you can write to .. it  
  14. supports
  15.  
  16.     put_character
  17.     put_string
  18.     write     /* buffer */
  19.     end
  20.     free
  21.  
  22. Some of the machinery works character by character
  23. (state machine parsers) but it's useful to have faster methods when
  24. there is no characterwise intervention.
  25.  
  26. This is to allow MIME encoding pipelines to be built, as well as the
  27. existing facilities to be more flexible.  Streams stack, and freeing
  28. the top of the stack frees off the stack.  As a side issue the stream
  29. idea allows the difference between sockets and FILE * to be overcome
  30. cleanly without the hacks necessary on some systems which shall be  
  31. nameless. Streams subclasses exist to
  32.  
  33.     write to a FILE *
  34.     write to a socket
  35.     parse an SGML file of (dtd)
  36.         pushing the results into (structured)
  37.     convert plain text to valid HTML -> other stream
  38.     format a (structured) described by (dtd) as plain text
  39.         pushing the results -> other stream
  40.     parse a MIME document (to come)
  41.  
  42. There is a different creation routine for each case.
  43. The "structured" object is a subclass of HTStream called  
  44. HTStructured. It is a sort of rich stream, accepting also the methods
  45.  
  46.     start_element(element_number, attributes)
  47.     end_element(elemenet_number)
  48.     put_entity(entity_number)
  49.  
  50. Obviously an HTStructured thing has a pointer to a DTD structure
  51. so that the element numbers and entity numbers make sense.
  52. Elements and entities are passed around as numbers so that the
  53. string lookup is only done once if at all.
  54.  
  55. Structued subclasses objects exist to
  56.  
  57.     Pretty-print structued text to plain text stream
  58.     Generate SGML for the stream, given its DTD
  59.     Present the structured object to the user
  60.  
  61. This last one is the one you browser writers hook into
  62. and it should be alot easier than tangling with styles.
  63.  
  64. You can also of course regenerate the stream from your
  65. widget and use the HTML generator structured object
  66. to write your file back to the server. (Thisis to
  67. encourage more hypertext editors out there!)
  68.  
  69. There is another class of object called a protocol.
  70. It supports GET and will soon support PUT and other
  71. useful things.  Current subclasses handle
  72.  
  73.     http
  74.     news
  75.     gopher
  76.     files and directories
  77.     FTP files and directories
  78.     WAIS without gateway will come
  79.  
  80. Typically News and Gophe protocol
  81. objects ask for a HTStructured object (which may
  82. in fact go to a display, or a client if we are a server, or
  83. a file etc through a small stream stack) and build it.
  84. Although the structured object is defined by a DTD,
  85. and has an SGML model, there is no generation of SGML from
  86. news, etc within a browser for speed (unless the user wants
  87. to save something as SGML).
  88.  
  89. Other things .. a common interface for alerts, confirmation and  
  90. questions to the user from the bowels of the library,  and sometime a  
  91. spinning callback for geting out of
  92. those long timeouts..
  93.  
  94. Constructive criticism welcome, I'll put the code out
  95. when I can.
  96.  
  97. Tim Berners-Lee
  98.  
  99.  
  100.  
  101.  
  102.